home *** CD-ROM | disk | FTP | other *** search
/ Freelog 55 / Freelog055.iso / Bas / Screen-Saver / Tocs / tocs.exe / Movie.swf / scripts / DefineSprite_20 / frame_1 / PlaceObject2_19_1 / CLIPACTIONRECORD onClipEvent(load).as < prev   
Text File  |  2002-02-25  |  2KB  |  79 lines

  1. onClipEvent(load){
  2.    function getFirstWeekDay(year, month, day, weekday)
  3.    {
  4.       tmp = new date(year,month,day);
  5.       tmp.setDate(day + (7 + weekday - tmp.getday()) % 7);
  6.       return tmp.getTime();
  7.    }
  8.    function getlastWeekDay(year, month, day, weekday)
  9.    {
  10.       tmp = new date(year,month,day);
  11.       tmp.setDate(day - (7 - weekday + tmp.getday()) % 7);
  12.       return tmp.getTime();
  13.    }
  14.    function getmonthLength(yr, month)
  15.    {
  16.       nm = month + 1;
  17.       ny = yr;
  18.       if(month == 11)
  19.       {
  20.          ny++;
  21.          nm = 0;
  22.       }
  23.       nw = new date(ny,nm,1);
  24.       ow = new date(yr,month,1);
  25.       return (nw.getday() - ow.getday() + 7) % 7 + 28;
  26.    }
  27.    curTime = new date();
  28.    shColor = new color(secondHand);
  29.    clp = new color(frame);
  30.    if(_parent.frameColor != "#-1")
  31.    {
  32.       clp.setRGB(parseInt("0x" + _parent.frameColor.substr(1)));
  33.    }
  34.    tz = _parent.timeZone;
  35.    if(0 < _parent.dayLight)
  36.    {
  37.       curYear = curTime.getFullYear();
  38.       if(_parent.bgdth == 0)
  39.       {
  40.          tmp = new date(curYear,_parent.bgmt,_parent.bgdt,0,0,0);
  41.          beginTime = tmp.getTime();
  42.       }
  43.       else if(_parent.bgdth == 1)
  44.       {
  45.          beginTime = getFirstWeekDay(curYear,_parent.bgmt,_parent.bgdt,_parent.bgd);
  46.       }
  47.       else
  48.       {
  49.          beginTime = getlastWeekDay(curYear,_parent.bgmt,getMonthLength(curYear,_parent.bgmt),_parent.bgd);
  50.       }
  51.       if(_parent.enddth == 0)
  52.       {
  53.          tmp = new date(curYear,_parent.endmt,_parent.enddt,23,59,59);
  54.          endTime = tmp.getTime();
  55.       }
  56.       else if(_parent.enddth == 1)
  57.       {
  58.          endTime = getFirstWeekDay(curYear,_parent.endmt,_parent.enddt,_parent.endd);
  59.       }
  60.       else
  61.       {
  62.          endTime = getlastWeekDay(curYear,_parent.endmt,getMonthLength(curYear,_parent.endmt),_parent.endd);
  63.       }
  64.       if(_parent.endmt < _parent.bgmt)
  65.       {
  66.          if(curTime.getTime() >= beginTime or endTime >= curTime.getTime())
  67.          {
  68.             tz += _parent.dayLight;
  69.          }
  70.       }
  71.       else if(curTime.getTime() >= beginTime and endTime >= curTime.getTime())
  72.       {
  73.          tz += _parent.dayLight;
  74.       }
  75.    }
  76.    zoneHours = 0 >= tz / 60 ? math.ceil(tz / 60) : math.floor(tz / 60);
  77.    zoneMinutes = tz % 60;
  78. }
  79.